package com.teaching.controller;

import com.teaching.common.Result;
import com.teaching.service.TeacherEfficiencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 教师教学效率统计控制器
 */
@RestController
@RequestMapping("/api/admin/statistics")
public class TeacherEfficiencyController {

    @Autowired
    private TeacherEfficiencyService teacherEfficiencyService;

    /**
     * 获取教师教学效率统计数据
     * @param department 教研组/学科
     * @param period 时间周期(week/month/semester/year)
     * @return 教师效率统计数据
     */
    @GetMapping("/teacher-efficiency")
    public Result getTeacherEfficiencyData(
            @RequestParam(required = false) String department,
            @RequestParam(required = false, defaultValue = "month") String period) {
        
        Map<String, Object> data = teacherEfficiencyService.getTeacherEfficiencyData(department, period);
        return Result.success(data);
    }
} 